<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div>
  {{info}}
  <input type="button" value="按钮1" v-on:click="f()">
  <input type="button" value="按钮2" @click="f()">
</div>
<script src="js/vue.js"></script>
<script>
  Vue.createApp({
    data() {
      return {
        info: "事件绑定"
      }
    },
    methods: {
      f() {
        alert("按钮被点击了!");
      }
    },
  }).mount("body>div");
</script>
</body>
</html>